﻿#include "StdAfx.h"

namespace ui
{
	Calendar::Calendar()
	{
		int monthDay[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		for (int i = 0; i < 12; i++)
			m_nMonthDay[i] = monthDay[i];

		m_bMouseClickEnabled = true;
		m_sControlClassName = L"Calendar";

		m_format = "yyyy-MM-dd";

		SetAttribute(L"bordersize", L"1");
		SetAttribute(L"bordercolor", L"gray");
	}

#if BUILD_XML_GUI	
	void Calendar::InitAttrVistor()
	{
		__super::InitAttrVistor();
		m_attrVistor.SetAttrDefaultValue(L"mouse", L"true");
		m_attrVistor.SetAttrDefaultValue(L"bordersize", L"1");
		m_attrVistor.SetAttrDefaultValue(L"bordercolor", L"gray");

		AttrOfClass attrs;
		ContrlAttrVistorItem item = { L"Calendar" };
		attrs.push_back(item);

		//basic
		{
			std::tuple<std::wstring, std::wstring, std::wstring> AttrNameBasic[] = {
			{ L"format", L"yyyy-MM-dd", L"string"}
			};
			int size = sizeof(AttrNameBasic) / sizeof(AttrNameBasic[0]);
			for (int i = 0; i < size; i++)
			{
				std::wstring AttrName = std::get<0>(AttrNameBasic[i]);
				item = { AttrName, std::get<1>(AttrNameBasic[i]), std::bind(&Calendar::GetBuildAttrString, this, AttrName), std::bind(&Calendar::SetBuildAttrString, this, AttrName, std::placeholders::_1), std::get<2>(AttrNameBasic[i]) };
				attrs.push_back(item);
			}
		}

		m_attrVistor.vecClass.emplace_back(attrs);
	}

	std::wstring Calendar::GetBuildAttrString(std::wstring sAttr) const
	{
		std::wstring V;
		if (sAttr == L"format") {
			std::wstring sFormat;
			if (StringHelper::MBCSToUnicode(GetFormat(), sFormat))
				V = sFormat;
		}
		else
			V = __super::GetBuildAttrString(sAttr);

		return V;
	}

#endif

	void Calendar::Init()
	{
		__super::Init();
		GlobalManager::FillBoxWithCache(this, L"public\\calendar\\calendar.xml");

		m_tabMain = static_cast<TabBox*>(FindSubControl(L"tab_main"));
		m_btnToday = static_cast<Button*>(FindSubControl(L"btn_today"));
		m_btnToday->AttachClick(nbase::Bind(&Calendar::OnBtnTodayClicked, this, std::placeholders::_1));

		VBox* box_hbox_day = static_cast<VBox*>(FindSubControl(L"box_hbox_day"));
		assert(box_hbox_day->GetCount() == 6);
		for (int i = 0; i < 6; i++)
			m_hboxDay[i] = (HBox*)box_hbox_day->GetItemAt(i);
		for (int i = 0; i < 42; i++)
		{
			int line = i / 7;
			assert(line < 6);
			CheckBox* chkDay = new CheckBox;
			m_hboxDay[line]->Add(chkDay);
			chkDay->SetClass(L"clsOptCalendar");
			chkDay->AttachSelect(nbase::Bind(&Calendar::OnChkDateSelected, this, std::placeholders::_1, i, true));
			chkDay->AttachUnSelect(nbase::Bind(&Calendar::OnChkDateSelected, this, std::placeholders::_1, i, false));
			m_chkDay[i] = chkDay;
		}

		VBox* box_hbox_month_year = static_cast<VBox*>(FindSubControl(L"box_hbox_month_year"));
		assert(box_hbox_month_year->GetCount() == 4);
		for (int i = 0; i < 4; i++)
			m_hboxMonthYear[i] = (HBox*)box_hbox_month_year->GetItemAt(i);
		for (int i = 0; i < 12; i++)
		{
			int line = i / 3;
			assert(line < 4);
			CheckBox* chkMonth = new CheckBox;
			m_hboxMonthYear[line]->Add(chkMonth);
			chkMonth->SetClass(L"clsChkMonthYear");
			chkMonth->AttachSelect(nbase::Bind(&Calendar::OnChkMonthYearSelected, this, std::placeholders::_1, i));
			m_chkMonthYear[i] = chkMonth;
		}

		m_btnPrev = static_cast<Button*>(FindSubControl(L"btn_prev"));
		m_btnYear = static_cast<Button*>(FindSubControl(L"btn_year"));
		m_btnMonth = static_cast<Button*>(FindSubControl(L"btn_month"));
		m_btnNext = static_cast<Button*>(FindSubControl(L"btn_next"));
		m_btnPrev->AttachClick(nbase::Bind(&Calendar::OnBtnPrevClicked, this, std::placeholders::_1));
		m_btnYear->AttachClick(nbase::Bind(&Calendar::OnBtnYearClicked, this, std::placeholders::_1));
		m_btnMonth->AttachClick(nbase::Bind(&Calendar::OnBtnMonthClicked, this, std::placeholders::_1));
		m_btnNext->AttachClick(nbase::Bind(&Calendar::OnBtnNextClicked, this, std::placeholders::_1));

		InitLocalDate();
	}

	void Calendar::SetAttribute(const std::wstring& strName, const std::wstring& strValue)
	{
		if (strName == L"format") SetFormat(strValue);
		else if (strName == L"mutilsel") SetMutilSel(strValue == _T("true"));
		else __super::SetAttribute(strName, strValue);
	}

	void Calendar::SetFormat(std::wstring sFormat)
	{
		if (sFormat.empty())
			return;
		std::string format;
		StringHelper::UnicodeToMBCS(sFormat, format, CP_UTF8);
		if (m_format == format) return;
		m_format = format;
		UpdateLabelToday();
	}

	std::string Calendar::GetFormatPrintf() const
	{
		std::string format = m_format;
		StringHelper::ReplaceAll("yyyy", "%04d", format);
		StringHelper::ReplaceAll("MM", "%02d", format);
		StringHelper::ReplaceAll("dd", "%02d", format);
		return format;
	}

	void Calendar::SetMutilSel(bool mutilSel)
	{
		if (m_bMutilSel == mutilSel)
			return;
		m_bMutilSel = mutilSel;
		if (!m_bMutilSel)
		{
			if (m_vecSelect.size() > 1) {
				m_vecSelect.erase(m_vecSelect.begin() + 1, m_vecSelect.end());
				SYSTEMTIME st = m_vecSelect[0];
				_ChangeSelType(0);
				UpdateCalendar(st.wYear, st.wMonth, 0);
			}	
		}
	}

	void Calendar::SetReadOnly(bool bReadOnly)
	{
		m_bReadOnly = bReadOnly;
		Invalidate();
	}

	void Calendar::InitLocalDate()
	{
		SYSTEMTIME st;
		::GetLocalTime(&st);
		m_stToday = st;

		UpdateLabelToday();
		UpdateCalendar(m_stToday.wYear, m_stToday.wMonth, 0);
	}

	bool Calendar::ClearSelect(bool jumpToToday)
	{
		if (m_vecSelect.empty())
			return false;
		m_vecSelect.clear();
		int nYear = jumpToToday ? m_stToday.wYear : m_nCurrYear;
		int nMonth = jumpToToday ? m_stToday.wMonth : m_nCurrMonth;
		UpdateCalendar(nYear, nMonth, 0);

		return true;
	}

	bool Calendar::RemoveSelect(int nYear, int nMonth, int nDay)
	{
		assert(IsDateSelected(nYear, nMonth, nDay));
		auto it = std::remove_if(m_vecSelect.begin(), m_vecSelect.end(), [nYear, nMonth, nDay](SYSTEMTIME& st) {return st.wYear == nYear && st.wMonth == nMonth && st.wDay == nDay; });
		if (it == m_vecSelect.end())
			return false;

		m_vecSelect.erase(it, m_vecSelect.end());
		_ChangeSelType(0);
		UpdateCalendar(nYear, nMonth, 0);

		if (m_pWindow)
			m_pWindow->SendNotify(this, kEventValueChange);
		return true;
	}	

	bool Calendar::SelectDate(int nYear, int nMonth, int nDay, bool update)
	{
		if (nYear <= 0 || nYear > 9999)
			return false;
		if (nMonth <= 0 || nMonth > 12)
			return false;
		if (nDay <= 0 || nDay > 31)
			return false;
		assert(!IsDateSelected(nYear, nMonth, nDay));
		if (IsDateSelected(nYear, nMonth, nDay))
			return false;
		bool ret = true;
		if (!m_bMutilSel)
			m_vecSelect.clear();

		SYSTEMTIME st = {};
		st.wYear = nYear;
		st.wMonth = nMonth;
		st.wDay = nDay;
		m_vecSelect.push_back(st);

		if (update)
		{
			_ChangeSelType(0);
			UpdateCalendar(nYear, nMonth, 0);
		}
		if (ret && m_pWindow)
			m_pWindow->SendNotify(this, kEventValueChange);
		return true;
	}
	bool Calendar::IsDateSelected(int nYear, int nMonth, int nDay) {
		bool selected = false;
		for (auto &it: m_vecSelect)
		{
			if (it.wYear == nYear && it.wMonth == nMonth && it.wDay == nDay)
			{
				selected = true;
				break;
			}
		}
		return selected;
	}

	std::string Calendar::GetDateSelectString() {
		assert(!m_bMutilSel);
		SYSTEMTIME st = {};
		if (!m_vecSelect.empty())
			st = m_vecSelect[0];
		std::string date;
		int nYear = st.wYear;
		int nMonth = st.wMonth;
		int nDay = st.wDay;
		
		if (nYear == 0 || nMonth == 0 || nDay == 0)
			date = "";
		else {
			std::string format = GetFormatPrintf();
			date = StringHelper::Printf(format.c_str(), nYear, nMonth, nDay);
		}	
		return date;
	}
	SYSTEMTIME Calendar::GetDateSelectValue() {
		assert(!m_bMutilSel);
		SYSTEMTIME st = {};
		if (!m_vecSelect.empty())
			st = m_vecSelect[0]; 
		return st;
	}
	std::vector<std::string> Calendar::GetDateSelectStringMutil() {
		assert(m_bMutilSel);
		std::string format = GetFormatPrintf();

		std::vector<std::string> vecDate;
		return vecDate;
	}

	bool Calendar::OnBtnTodayClicked(ui::EventArgs* args)
	{
		_ChangeSelType(0);
		UpdateCalendar(m_stToday.wYear, m_stToday.wMonth, 0);
		return true;
	}

	bool Calendar::OnBtnPrevClicked(ui::EventArgs* args)
	{
		if (m_nSelType == 0)
		{
			int nYear = m_nCurrYear;
			int nMonth = m_nCurrMonth;
			assert(nMonth > 0 && nMonth < 13);
			if (nMonth == 1)
			{
				nMonth = 12;
				nYear -= 1;
			}
			else
				nMonth--;
			UpdateCalendar(nYear, nMonth, 0);
		}
		else if (m_nSelType == 2)
		{
			assert(m_nYearStart > 13);
			UpdateCalendarYear(m_nYearStart - 12, m_nYearStart - 1);
		}
		else if (m_nSelType == 3)
		{
			assert(m_nYearStart > 145);
			UpdateCalendarYearRange(m_nYearStart - 144, m_nYearStart - 1);
		}
		return true;
	}
	bool Calendar::OnBtnYearClicked(ui::EventArgs* args)
	{
		if (m_nSelType == 2)
			_ChangeSelType(3);
		else if (m_nSelType == 3)
			_ChangeSelType(0);
		else 
			_ChangeSelType(2);

		if (m_nSelType == 0)
			UpdateCalendar(m_nCurrYear, m_nCurrMonth, 0);
		else if (m_nSelType == 2)
			UpdateCalendarYear(m_nCurrYear - 8, m_nCurrYear + 3);
		else if (m_nSelType == 3)
			UpdateCalendarYearRange(m_nCurrYear - 8 * 12, m_nCurrYear + 4 * 12 - 1);
		return true;
	}
	bool Calendar::OnBtnMonthClicked(ui::EventArgs* args)
	{
		if (m_nSelType == 1)
		{
			_ChangeSelType(0);
			UpdateCalendar(m_nCurrYear, m_nCurrMonth, 0);
		}
		else {
			_ChangeSelType(1);
			UpdateCalendarMonth();
		}
		
		return true;
	}
	bool Calendar::OnBtnNextClicked(ui::EventArgs* args)
	{
		if (m_nSelType == 0)
		{
			int nYear = m_nCurrYear;
			int nMonth = m_nCurrMonth;
			assert(nMonth > 0 && nMonth < 13);
			if (nMonth == 12)
			{
				nMonth = 1;
				nYear += 1;
			}
			else
				nMonth++;
			UpdateCalendar(nYear, nMonth, 0);
		}
		else if (m_nSelType == 2)
		{
			assert(m_nYearStart > 13);
			UpdateCalendarYear(m_nYearEnd + 1, m_nYearEnd + 12);
		}
		else if (m_nSelType == 3)
		{
			UpdateCalendarYearRange(m_nYearEnd + 1, m_nYearEnd + 144);
		}
		return true;
	}

	bool Calendar::OnChkDateSelected(ui::EventArgs* args, int index, bool selected)
	{
		assert(m_nSelType == 0);
		if (m_nSelType != 0)
			return true;
		if (index < 0 || index >= 42)
			return true;
		/*assert(!m_bMutilSel);
		if (!m_bMutilSel)*/
		{
			/*for (int i = 0; i < 42; i++)
			{
				if (i == index)
					continue;
				if (m_chkDay[i]->IsSelected())
					m_chkDay[i]->Selected(false, false);
			}*/
			int nYear = m_nCurrYear;
			int nMonth = m_nCurrMonth;
			int nDay = 0;
			if (index < m_nCurrMonthStartIndex) {		//上个月的日期
				nMonth--;
				if (nMonth == 0)
				{
					nMonth = 12;
					nYear--;
				}
				int nPrevMonthDayCount = _GetMonthDayCount(nYear, nMonth);
				nDay = nPrevMonthDayCount - (m_nCurrMonthStartIndex - index) + 1;
			}
			else if (index > m_nCurrMonthEndIndex){	//下个月的日期
				nMonth++;
				if (nMonth == 13)
				{
					nMonth = 1;
					nYear++;
				}
				nDay = index - m_nCurrMonthEndIndex;
			}
			else {									//这个月的日期
				nDay = index - m_nCurrMonthStartIndex + 1;
			}
			assert(nDay > 0 && nDay <= 31);
			assert(nMonth > 0 && nMonth <= 12);
			assert(selected ^ IsDateSelected(nYear, nMonth, nDay));
			if (selected/* && !IsDateSelected(nYear, nMonth, nDay)*/)
			{
				SelectDate(nYear, nMonth, nDay);
			}
			else if (!selected/* && IsDateSelected(nYear, nMonth, nDay)*/)
			{
				RemoveSelect(nYear, nMonth, nDay);
			}
		}
		return true;
	}

	bool Calendar::OnChkMonthYearSelected(ui::EventArgs* args, int index)
	{
		assert(m_nSelType > 0);
		assert(index >= 0 && index < 12);
		if (m_nSelType == 1)
		{
			int nMonth = index + 1;
			_ChangeSelType(0);
			UpdateCalendar(m_nCurrYear, nMonth, 0);
		}
		else if (m_nSelType == 2)
		{
			int nYear = m_nYearStart + index;
			_ChangeSelType(0);
			UpdateCalendar(nYear, m_nCurrMonth, 0);
		}
		else if (m_nSelType == 3)
		{
			int nYearStart = m_nYearStart + index * 12;
			_ChangeSelType(2);
			UpdateCalendarYear(nYearStart, nYearStart + 11);
		}
		return true;
	}

	void Calendar::UpdateCalendar(int nYear, int nMonth, int nDay)
	{
		assert(m_nSelType == 0);
		if (m_nSelType != 0)
			return;
		int nMonthDayCount = _GetMonthDayCount(nYear, nMonth);
		int dayweek = _GetDayWeek(nYear, nMonth, 1);			//每个月1号的星期; 0-周日
		assert(nMonthDayCount > 0 && dayweek != -1);
		if (nMonthDayCount <= 0 || dayweek == -1)
			return;
		
		//上个月的
		int prevMonth = nMonth - 1;
		int prevYear = nYear;
		if (prevMonth == 0) {
			prevMonth = 12;
			prevYear--;
		}
		int nPrevMonthDayCount = _GetMonthDayCount(prevYear, prevMonth);
		for (int i = 0; i < dayweek; i++)		
		{
			m_chkDay[i]->SetClass(L"clsOptCalendarGray");
			m_chkDay[i]->SetUTF8Text(std::to_string(nPrevMonthDayCount - dayweek + i + 1));
			bool selected = false;
			for (auto &it : m_vecSelect)
			{
				if (prevYear == it.wYear && prevMonth == it.wMonth && nPrevMonthDayCount - dayweek + i + 1 == it.wDay)
				{
					selected = true;
					break;
				}
			}
			m_chkDay[i]->Selected(selected, false);

			if (prevYear == m_stToday.wYear && prevMonth == m_stToday.wMonth && nPrevMonthDayCount - dayweek + i + 1 == m_stToday.wDay)
				m_chkDay[i]->SetStateImage(kControlStateNormal, L"file='public/calendar/circle_green12.png' dest='16,0,26,10'");
			else if (!m_chkDay[i]->GetStateImageString(kControlStateNormal).empty())
				m_chkDay[i]->SetStateImage(kControlStateNormal, L"");

		}
		//这个月的
		for (int i = 0; i < nMonthDayCount; i++)
		{
			m_chkDay[dayweek + i]->SetClass(L"clsOptCalendar");
			m_chkDay[dayweek + i]->SetUTF8Text(std::to_string(i + 1));
			bool selected = false;
			for (auto& it : m_vecSelect)
			{
				if (nYear == it.wYear && nMonth == it.wMonth && i + 1 == it.wDay)
				{
					selected = true;
					break;
				}
			}
			m_chkDay[dayweek + i]->Selected(selected, false);

			if (nYear == m_stToday.wYear && nMonth == m_stToday.wMonth && i + 1 == m_stToday.wDay)
				m_chkDay[dayweek + i]->SetStateImage(kControlStateNormal, L"file='public/calendar/circle_green12.png' dest='16,0,26,10'");
			else if (!m_chkDay[dayweek + i]->GetStateImageString(kControlStateNormal).empty())
				m_chkDay[dayweek + i]->SetStateImage(kControlStateNormal, L"");
		}
		//下个月的
		int nextMonth = nMonth + 1;
		int nextYear = nYear;
		if (nextMonth == 13) {
			nextMonth = 1;
			nextYear++;
		}
		int nextMonthIndex = dayweek + nMonthDayCount;
		for (int i = nextMonthIndex; i < 42; i++)
		{
			m_chkDay[i]->SetClass(L"clsOptCalendarGray");
			m_chkDay[i]->SetUTF8Text(std::to_string(i + 1 - (nextMonthIndex)));
			bool selected = false;
			for (auto& it : m_vecSelect)
			{
				if (nextYear == it.wYear && nextMonth == it.wMonth && i + 1 - nextMonthIndex == it.wDay)
				{
					selected = true;
					break;
				}
			}
			m_chkDay[i]->Selected(selected, false);

			if (nextYear == m_stToday.wYear && nextMonth == m_stToday.wMonth && i + 1 - nextMonthIndex == m_stToday.wDay)
				m_chkDay[i]->SetStateImage(kControlStateNormal, L"file='public/calendar/circle_green12.png' dest='16,0,26,10'");
			else if (!m_chkDay[i]->GetStateImageString(kControlStateNormal).empty())
				m_chkDay[i]->SetStateImage(kControlStateNormal, L"");
		}
		m_nCurrYear = nYear;
		m_nCurrMonth = nMonth;
		m_nCurrMonthStartIndex = dayweek;
		m_nCurrMonthEndIndex = nextMonthIndex - 1;

		m_btnYear->SetText(std::to_wstring(nYear) + L"年");
		m_btnMonth->SetText(std::to_wstring(nMonth) + L"月");
	}

	void Calendar::UpdateCalendarMonth()
	{
		assert(m_nSelType == 1);
		if (m_nSelType != 1)
			return;
		int nCurrMonth = m_nCurrMonth;
		assert(nCurrMonth >= 1 && nCurrMonth <= 12);
		//m_tabMain->SelectItem(1);
		for (int i = 0; i < 12; i++)
		{
			m_chkMonthYear[i]->SetText(std::to_wstring(i + 1) + L"月");
			if (i + 1 == nCurrMonth)
				m_chkMonthYear[i]->Selected(true, false);
			else
				m_chkMonthYear[i]->Selected(false, false);
		}
	}
	void Calendar::UpdateCalendarYear(int nStartYear, int nEndYear)
	{
		assert(m_nSelType == 2);
		if (m_nSelType != 2)
			return;
		assert(nEndYear - nStartYear == 11);
		//m_tabMain->SelectItem(1);

		int nCurrYear = m_nCurrYear;
		for (int i = 0; i < 12; i++)
		{
			m_chkMonthYear[i]->SetText(std::to_wstring(i + nStartYear) + L"年");
			if (i + nStartYear == nCurrYear)
				m_chkMonthYear[i]->Selected(true, false);
			else
				m_chkMonthYear[i]->Selected(false, false);
		}
		m_nYearStart = nStartYear;
		m_nYearEnd = nEndYear;
	}
	void Calendar::UpdateCalendarYearRange(int nStartYear, int nEndYear)
	{
		assert(m_nSelType == 3);
		if (m_nSelType != 3)
			return;
		assert(nEndYear - nStartYear == 143);
		int nYear = nStartYear;
		for (int i = 0; i < 12; i++)
		{
			m_chkMonthYear[i]->SetText(std::to_wstring(nYear) + L"-" + std::to_wstring(nYear + 11));
			nYear += 12;
		}
		assert(nYear - 1 == nEndYear);

		m_nYearStart = nStartYear;
		m_nYearEnd = nEndYear;
	}
	void Calendar::UpdateLabelToday()
	{
		std::string today = _FormatDate(m_stToday.wYear, m_stToday.wMonth, m_stToday.wDay);
		std::wstring sToday;
		StringHelper::MBCSToUnicode(today, sToday);
		sToday = L"今日: " + sToday;
		m_btnToday->SetText(sToday);
	}

	int Calendar::_GetMonthDayCount(int nYear, int nMonth)
	{
		assert(nYear > 0 && nYear < 9999);
		if (nYear <= 0 && nYear >= 9999)
			return 0;
		assert(nMonth > 0 && nMonth <= 12);
		if (nMonth <= 0 || nMonth > 12)
			return 0;
		
		int nDay = m_nMonthDay[nMonth - 1];
		if (nMonth == 2)
		{
			if ((nYear % 400 == 0) || (nYear % 4 == 0 && nYear % 100 != 0))
				nDay += 1;
		}
		return nDay;
	}

	int Calendar::_GetDayWeek(int nYear, int nMonth, int nDay)
	{
		int nDayCount = _GetMonthDayCount(nYear, nMonth);
		assert(nDayCount > 0);
		if (nDay <= 0 || nDay > nDayCount)
			return -1;
		if (nMonth == 1 || nMonth == 2)
		{
			nMonth += 12;
			nYear--;
		}

		/*基姆•拉尔森公式可以由公历的年月日推导出当天的星期。
		w = (d + 2m + 3(m + 1) / 5 + y + y / 4 - y / 100 + y / 400 + 1) % 7
		d 为日期，范围是1 - 31
		m 为月份，范围是3 - 14，当年的1，2月需处理为上一年的13，14月。
		y为年份，当月份为1，2时，y需减一。
		结果w为0 - 6，星期日用0表示，星期一为1，以此类推，星期六为6*/
		int w = (nDay + 2 * nMonth + 3 * (nMonth + 1) / 5 + nYear + nYear / 4 - nYear / 100 + nYear / 400 + 1) % 7;
		return w;
	}

	void Calendar::_ChangeSelType(int nType)
	{
		assert(nType >= 0 && nType < 4);
		if (m_nSelType == nType)
			return;
		m_nSelType = nType;
		if (m_nSelType == 0)
			m_tabMain->SelectItem(0);
		else/* if (m_nSelType == 0)*/
			m_tabMain->SelectItem(1);
		m_btnPrev->SetEnabled(m_nSelType != 1);
		m_btnNext->SetEnabled(m_nSelType != 1);
	}

	std::string Calendar::_FormatDate(int nYear, int nMonth, int nDay)
	{
		assert(nYear > 0 && nMonth > 0 && nDay > 0);
		std::string date;
		if (nYear == 0 || nMonth == 0 || nDay == 0)
			date = "";
		else {
			std::string format = GetFormatPrintf();
			date = StringHelper::Printf(format.c_str(), nYear, nMonth, nDay);
		}
		return date;
	}
}
